<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>时间对象练习</title>
</head>
<body>
	
</body>
</html>

<script>
//获取当地时间信息
var date = new Date();
console.log(date);


//获取时间戳
console.log(date.getTime());


//时间对象常用的API
//getFullYear()
console.log(date.getFullYear()+"年");


var setFY =new Date();
console.log(setFY.setFullYear("2017"));
console.log(setFY.setFullYear("2016"));
//getMonth()
console.log(date.getMonth()+1+"月");


//getDate()
console.log(date.getDate()+"日");



//getHours
console.log(date.getHours()+"点");




//getMinutes()
console.log(date.getMinutes()+"分");


//getSeconds()
console.log(date.getSeconds()+"秒");

//getDay()
console.log("星期"+date.getDay());














</script>